<template>
<!-- 首页-推荐私教-选项卡 -->
  <div class="private_education">
    <div class="item" @click="toXQ" :data-id="item.coach_id" v-for="item in classPeData" :key="item.coach_id">
      <div>
        <img :src="item.coach_img" alt="">
      </div>
      <div class="itemText">
        <div class="itemName">
          <span>{{item.coach_name}}</span>
          <span>
            <img src="../assets/praise.svg">
            <span>{{item.coach_star}}</span>
          </span>
          <span>
            <span>￥</span>
            <span>{{item.coach_price}}</span>
            <span> /节起</span>
          </span>
        </div>
        <span class="praise">已累计上课<span> {{item.num}} </span>节</span>
        <div class="itemTarget">
          <span v-for="good in item.coach_good.split(',')" :key="good">{{good}}</span>
        </div>
        <span class="introduce">{{item.coach_introduce}}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'PrivateEducation',
  props: ['classPeData'],
  mounted() {
    // console.log(this.classPeData)
  },
  methods: {
    // 点击私教选项卡时，传参数：coach_id
    toXQ(e) {
      // console.log(e)
    }
  }
}
</script>
<style scoped>
.item{
  padding: 1vw 2vw;
  display: flex;
  align-items: center;
}
.item img{
  width: 35vw;
  height: 35vw;
  border-radius: 2vw;
}
.item>.itemText{
  width: 69.5vw;
  margin-left: 1.5vw;
  display: flex;
  flex-direction: column;
  color: #666;
  font-size: 4vw;
}
.item>.itemText>.itemName{
  margin-bottom: 1vw;
}
.item>.itemText>.praise,
.item>.itemText>.itemTarget>span{
  margin: 2vw 0;
}
.item>.itemText>.itemName{
  display: flex;
  justify-content: space-between;
}
.item>.itemText>.itemName>span:nth-child(2){
  align-items: center;
  display: flex;
  font-size: 4vw;
}
.item>.itemText>.itemName>span:nth-child(2)>img{
  width: 4.5vw;
  height: 4.5vw;
  margin-right: 2px;
}
.item>.itemText>.itemName>span:nth-child(2)>span{
  display: inline-block;
  margin: auto 0;
  margin-bottom: 3px;
}
.item>.itemText>.itemName>span:first-child{
  font-weight: bold;
  font-size: 5vw;
  color: #000;
  align-items: center;
  display: flex;
}
.item>.itemText>.itemName>span:last-child{
  color: #aaa;
}
.item>.itemText>.itemName>span:last-child>span:nth-child(1){
  font-size: 2vw;
  color: #f00;
  font-weight: bold;
}
.item>.itemText>.itemName>span:last-child>span:nth-child(2){
  font-size: 5vw;
  color: #f00;
  font-weight: bold;
}
.item>.itemText>.itemName>span:last-child>span:nth-child(3){
  font-size: 2vw;
}
.item>.itemText>.praise>span{
  color: #f00;
}
.item>.itemText>.itemTarget>span{
  display: inline-block;
  background-color: rgb(230, 230, 230);
  padding: 1vw 2vw;
  margin-right: 1vw;
  border-radius: 2vw;
}
.item>.itemText>.introduce{
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>
